<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'testanimate.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="<%=basePath%>JS/jquery-ui-1.11.2/external/jquery/jquery.js"></script>
	<script type="text/javascript" src="<%=basePath%>JS/jquery-ui-1.11.2/jquery-ui.js"></script>
	<script type="text/javascript" src="<%=basePath%>JS/jquery-validation-1.13.1/dist/jquery.validate.js"></script>
	<script type="text/javascript" src="<%=basePath%>JS/WongDatePicker.js"></script>
	<link rel="stylesheet" type="text/css" href="<%=basePath%>JS/jquery-ui-1.11.2/jquery-ui.css">
	<link rel="stylesheet" type="text/css" href="<%=basePath%>CSS/style.css">
	<link rel="stylesheet" type="text/css" href="<%=basePath%>JS/jquery-validation-1.13.1/demo/css/screen.css">


  </head>
  <style>
  	.demo{
  		width:200px;
  		height:25px;
  		background:#fff;
  		border:1px solid #000;
  		position:absolute;
  		left:180px;
  		padding:12px 20px;
  	}
  </style>
  
  <body>
  	<div id="demo" class="demo">
  		<button onclick="javascript:alert();">click me</button>
  	</div>
    
  </body>
  <script>
  
   $(function(){
	   function animateMade(element,speed){
		   if($(".demo").css("left")=="980px"){
			   $(".demo").css("left","180px");
		   }
		   element.animate({"left":"+=800px","top":"+=0px"},speed,"swing",function(){animateMade($("#demo"),12000);});
	   }
	    animateMade($("#demo"),12000); 	   
   });
  
  </script>
</html>
